﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ZhuXingFamilys.ExportExcel.utils
{
	public class NpoiMemoryStream : MemoryStream
	{
		public NpoiMemoryStream() 
		{
			AllowClose = true;
		}
		public NpoiMemoryStream(byte[] buffer)
			: base(buffer, writable: true)
		{ 
		}

		public bool AllowClose { get; set; }

		public override void Close()
		{
			if(AllowClose)
			{
				base.Close();
			}
		}
	}
}
